/**
 * Created by walkman on 2017/6/25.
 */
'user strict';

(function () {

  angular.module('WfbPlatformApp').controller('TeamAwardController',
    ['$rootScope', '$scope', '$http', '$compile', 'http', '$q', 'teamService',
      function ($rootScope, $scope, $http, $compile, http, $q, teamService) {

        $scope.inviteContent = {};

        $scope.$on('$viewContentLoaded', function () {
          // initialize core components
          // jQuery("#direct-d_clip_button")
          //   .on("beforecopy copy aftercopy", function (e) {
          //     console.log("Direct binding - " + e.type + " - #" + e.target.id);
          //     //console.dir(e);
          //   })
          //   .on("copy", function (e) {
          //     e.clipboardData.clearData();
          //     e.clipboardData.setData("text/plain", jQuery('#fe_text').text());
          //     // e.clipboardData.setData("text/html", "<b>Direct binding - FOO</b>");
          //     alert("复制成功!");
          //     e.preventDefault();
          //   });
        });

        $scope.$on('$includeContentLoaded', function () {

        });

        $scope.getInviteContent = function () {
          var promise = teamService.getInviteContent({});
          promise.then(function success(result) {
            //成功回调
            $scope.inviteContent = angular.copy(result.data);
          }, function error(error) {
            //错误回调
            // console.log(JSON.stringify(error));
          });
        };

        $scope.getTextToCopy = function () {
          return $scope.inviteContent.inviteUrl;
        };

        $scope.getInviteContent();

      }]
  );

})();




